cmake_minimum_required(VERSION 3.5)
project(zstd-jni)
file(STRINGS "version" NATIVE_VERSION)
find_package(JNI)
include_directories("src/main/native" "src/main/native/common" "src/main/native/compress" "src/main/native/decompress" "src/main/native/dictBuilder" "src/main/native/legacy")
if (JNI_FOUND)
    include_directories(${JNI_INCLUDE_DIRS})
endif (JNI_FOUND)
file(GLOB_RECURSE SOURCES RELATIVE ${CMAKE_SOURCE_DIR} "src/*.c")
add_library(zstd-jni-${NATIVE_VERSION} SHARED ${SOURCES})
add_definitions("-DZSTD_MULTITHREAD=1")
add_definitions("-DZSTD_LEGACY_SUPPORT=4")
add_definitions("-Oz")
